#用类封装一个MyMath类
class MyMath:
    def add(self, a, b):
        return a + b

    def sub(self, a, b):
        return a - b

    def mul(self, a, b):
        return a * b

    def div(self, a, b):
        return a / b

    def ediv(self, a, b):
        return a // b

    def rem(self, a, b):
        return a % b

    def sqrt(self, a, b):
        return float(a ** (1 / 2))
a = MyMath()
a. add(5, 6)

#定义类
class Dog:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def sit(self):
        print(f"{self.name} is now sitting.")

    def roll(self):
        print(f"{self.name} rolled ouer!")

my_dog = Dog("Tom", 8)
print(f"My dog's name is {my_dog.name}.")
print(f"My dog is {my_dog.age} years old.")
